<%@ page language="java" contentType="text/html; charset=ISO-8859-1"  pageEncoding="ISO-8859-1"%>
<%@ taglib prefix ="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<jsp:include page="/jsp/part/header.jsp" />
	<title>Maxi ERP</title>
</head>
<body>
	<div class="contenu">
		<jsp:include page="/jsp/part/menu.jsp" />
		<div class="container-fluid">
			<div class="row-fluid">
				<div id="left_menu" class="span3">
					<jsp:include page="/jsp/part/action_menu.jsp" />
				</div>
				<div class="span9">
					<!-- listing -->
					<h2>Resultats :</h2>
					<div>
						<c:if test="${ids !=''}">
							<a href="/SiteERP/customer/?action=email&ids=${ids}" class="btn btn-primary" >Envoyer mail a tous</a><br/><br />
						</c:if>
						<c:if test="${list_customers != null}">
							<c:choose>
							     <c:when test="${fn:length(list_customers) == 0}">
							      	<p>Aucuns r&eacute;sultat touv&eacute;es</p>
							     </c:when>
							
							      <c:otherwise>
							      	<table class="table table-bordered table-striped table-hover">
									<thead>
										<tr>
											<th> # </th>
											<th> action </th>
											<th> name </th>
											<th> surname </th>
											<th> phone </th>
											<th> email </th>
										</tr>
									</thead>
									<tbody>
								      	<c:forEach items="${list_customers}" var="item">
											<tr>								
												<td><c:out value="${item.id}"/></td>
												<td style="text-align:center">
													<a href='/SiteERP/customer/?action=edit&id=${item.id}'><i class="icon icon-edit"></i></a>
													<a href='/SiteERP/customer/?action=delete&id=${item.id}'><i class="icon icon-remove"></i></a>
													<a href='/SiteERP/customer/?action=email&id=${item.id}'><i class="icon icon-envelope"></i></a>
												</td>
												<td> <c:out value="${item.name}"/> </td>
												<td> <c:out value="${item.surname}"/> </td>
												<td> <c:out value="${item.phoneNumber}"/> </td>
												<td> <c:out value="${item.emailAddress}"/> </td>
											</tr> 
										</c:forEach>
						      
									</tbody>	
								</table>
							</c:otherwise>
						</c:choose>
					</c:if>
					</div>	
				</div>
			</div>
		</div>
	</div>

</body>
</html>